import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

public class RedisDemo {
    public static void test1(Jedis jedis) {
        // 测试 get 与 set
        jedis.set("key","111");
        jedis.set("key2","222");
        String result = jedis.get("key2");
        System.out.println("vlue = " + result);
    }
    public static void main(String[] args) {
        JedisPool jedisPool = new JedisPool("tcp://127.0.0.1:8888");

        try(Jedis jedis = jedisPool.getResource()) {
            String pong = jedis.ping();
            System.out.println(pong);
            test1(jedis);
        }
    }
}
